<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>系统登陆</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
function txcheck(){	
	if(formvalidator("all"))
	{
		document.getElementById('form1').submit();
	}
}
function loginreset(){	
	document.getElementById('form1').reset();
}
function formvalidator(obj)
{
	
	var controlId = "all";
	 if (typeof(obj) != "string" )
	 {
		 controlId = obj.id;
	 }
	if(controlId=="all" || controlId=="model.loginName")
	{
		if(document.getElementById("model.loginName").value=="")
		{
			document.getElementById('model.loginName').style.borderColor = 'red';
			document.getElementById('model.loginName').style.backgroundColor = 'red';
			return false;
		}
		else
		{
			document.getElementById('model.loginName').style.borderColor = '';
			document.getElementById('model.loginName').style.backgroundColor = '';
		}
	}
	if(controlId=="all" || controlId=="model.password")
	{
		if(document.getElementById("model.password").value=="")
		{
			document.getElementById('model.password').style.borderColor = 'red';
			document.getElementById('model.password').style.backgroundColor = 'red';
			return false;
		}
		else
		{
			document.getElementById('model.password').style.borderColor = '';
			document.getElementById('model.password').style.backgroundColor = '';
		}
	}
	if(controlId=="all" || controlId=="code")
	{
		if(document.getElementById("code").value=="")
		{
			document.getElementById('code').style.borderColor = 'red';
			document.getElementById('code').style.backgroundColor = 'red';
			return false;
		}
		else
		{
			document.getElementById('code').style.borderColor = '';
			document.getElementById('code').style.backgroundColor = '';
		}
	}
	
	return true;
}
document.onkeydown = function(e)
{
    var k = e||event; //兼容Firefox
	if( k.keyCode == 13 )
	{
		txcheck();
	}
};
window.onload = function(){
	if (window.top!=window.self)  
	{
		window.top.location="login_ad.do";
	}
};
</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form id='form1' name='form1' method='post' onsubmit='return txcheck();' action="login_main.do">
<div align="center" width="100%" style="padding-top:80px;">
<table id="__01" width="924" height="499" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td colspan="2" rowspan="10">
			<img src="images/index_01.gif" width="568" height="428" alt=""></td>
		<td colspan="8">
			<img src="images/index_02.gif" width="356" height="153" alt=""></td>
	</tr>
	<tr>
		<td colspan="8">
			<img src="images/index_03.gif" width="356" height="68" alt=""></td>
	</tr>
	<tr>
		<td rowspan="7">
			<img src="images/index_04.gif" width="125" height="158" alt=""></td>
		<td colspan="5" width="176" height="31" background="images/indextxtbg.gif">
		<input id="model.loginName" placeholder="请输入用户账号" name="model.loginName" onblur="formvalidator(this)"/>
			</td>
		<td colspan="2" rowspan="7">
			<img src="images/index_06.gif" width="55" height="158" alt=""></td>
	</tr>
	<tr>
		<td colspan="5">
			<img src="images/index_07.gif" width="176" height="7" alt=""></td>
	</tr>
	<tr>
		<td colspan="5" width="176" height="30" background="images/indextxtbg.gif">
		<input type="password" id="model.password" placeholder="请输入用户密码" name="model.password" onblur="formvalidator(this)"/>
			</td>
	</tr>
	<tr>
		<td colspan="5">
			<img src="images/index_09.gif" width="176" height="3" alt=""></td>
	</tr>
	<tr>
		<td colspan="5" width="176" height="30" background="images/indextxtbg.gif" valign="middle">
		<input id="code" name="code" size="5" onblur="formvalidator(this)"/>&nbsp;&nbsp;
		<img alt="看不清楚？换一张" title="看不清楚？换一张" src="./codepicservlet" style="cursor: pointer;" 
               onclick= "this.src='./codepicservlet?s='+Math.random()"/>
			</td>
	</tr>
	<tr>
		<td colspan="5" width="176" height="35" background="images/index_11.gif">
		<font color="red" size="2px"><s:property value="msg"/></font></td>
	</tr>
	<tr>
		<td>
			<img src="images/index_12.gif" width="21" height="22" alt=""></td>
		<td width="48" height="22">
			<a style="cursor:pointer;" onclick="txcheck()"><img src="images/index_13.gif" alt=""></a></td>
		<td>
			<img src="images/index_14.gif" width="12" height="22" alt=""></td>
		<td>
			<a style="cursor:pointer;" onclick="loginreset()"><img src="images/index_15.gif" width="46" height="22" alt=""></a></td>
		<td>
			<img src="images/index_16.gif" width="49" height="22" alt=""></td>
	</tr>
	<tr>
		<td colspan="8">
			<img src="images/index_17.gif" width="356" height="49" alt=""></td>
	</tr>
	<tr>
		<td>
			<img src="images/index_18.gif" width="52" height="70" alt=""></td>
		<td colspan="8"  width="850" height="70" background="images/index_22.gif">
			</td>
		<td>
			<img src="images/index_20.gif" width="22" height="70" alt=""></td>
	</tr>
	<tr>
		<td>
			<img src="images/index_21.gif" width="52" height="1" alt=""></td>
		<td>
			<img src="images/index_21.gif" width="516" height="1" alt=""></td>
		<td>
			<img src="images/index_21.gif" width="125" height="1" alt=""></td>
		<td>
			<img src="images/index_21.gif" width="21" height="1" alt=""></td>
		<td>
			<img src="images/index_21.gif" width="48" height="1" alt=""></td>
		<td>
			<img src="images/index_21.gif" width="12" height="1" alt=""></td>
		<td>
			<img src="images/index_21.gif" width="46" height="1" alt=""></td>
		<td>
			<img src="images/index_21.gif" width="49" height="1" alt=""></td>
		<td>
			<img src="images/index_21.gif" width="33" height="1" alt=""></td>
		<td>
			<img src="images/index_21.gif" width="22" height="1" alt=""></td>
	</tr>
</table>
</div>
</form>
<!-- End Save for Web Slices -->
</body>
</html>